<?php
	header("Content-type: text/html;charset=utf8");
	require_once("../db/dbclass.php");
	require_once("../model/userinfo.php");
	require_once("../utils/common.php");
	require_once("../utils/config.php");
	$myDb=&DbController::getInstance();
	$param="select * from yj_plugin";
	$result_arr=array();
	$result=$myDb->exec_query($param);
	if($result==TRUE){
		$i=0;
		while ($row=mysqli_fetch_array($result,MYSQL_ASSOC)) {
			$arrayName = array('plugin_id' => $row['plugin_id'], 
				'plugin_name'=>$row['plugin_name'],
				'picture'=>URL_ADMIN.substr($row['plugin_picture'],2),
				'vision'=>$row['plugin_vision'],
				'plugin'=>URL_ADMIN.substr($row['plugin'],2),
				'issue_time'=>$row['issue_time'],
				'introduce'=>$row['plugin_introduce']
				);
			$result_arr[$i++]=$arrayName;
		}
		$arr = array('result' =>"success",
		"plug"=>$result_arr );
		echo json_encode($arr);
		return;
	}
	$arr = array('result' =>"failure",
	"plug"=>$result_arr );
	echo json_encode($arr);
?>